import type { User,CodeType,UserInfo, PatientList,Patient } from "@/types/user";
import { request } from "@/utiles/request";
// 密码登录接口
export const userLogin = (data: any) =>{
  return request.post<User>("/login/password", data);
}
// 发送验证码接口
export const sendMobileCode = (mobile: string,type: CodeType) => request.get<any,{code: string}>('/code',{ params: { mobile, type } })
// 发送验证码登录接口
export const loginByMobile = (mobile: string,code: string) => request.post<User>('/login',{mobile,code})
// 获取用户个人信息接口
export const getUserInfo = () => request.get<UserInfo, any>('/patient/myUser')
// 获取患者信息列表
export const getPatientList = () => request.get<PatientList>('/patient/mylist')
// 添加患者接口
export const addPatient = (patient: Patient) => request.post('/patient/add', patient);
// 编辑患者接口
export const editPatient = (patient: Patient) => request.put('/patient/update', patient);
// 删除患者信息
export const delPatient = (id: string) => request(`/patient/del/${id}`, { method: 'DELETE' })
// 查询患者详情
export const getPatientDetail = (id: string) => request<Patient>(`/patient/info/${id}`)
